
func void ZS_Stand_WP()
{
	if((self.guild == GIL_ORC) || (self.aivar[AIV_MM_REAL_ID] == ID_ORCBF))
	{
		Perception_Set_Monster_Rtn();
		AI_SetWalkMode(self,NPC_WALK);
		B_MM_DeSynchronize();
		if(Hlp_StrCmp(Npc_GetNearestWP(self),self.wp) == FALSE)
		{
			AI_GotoWP(self,self.wp);
		};
		if(Wld_IsFPAvailable(self,"FP_ROAM"))
		{
			AI_GotoFP(self,"FP_ROAM");
		}
		else
		{
			AI_AlignToWP(self);
		};
		AI_ReadyMeleeWeapon(self);
		self.aivar[AIV_TAPOSITION] = NOTINPOS;
	}
	else
	{
		Perception_Set_Normal();
		B_ResetAll(self);
		AI_SetWalkMode(self,NPC_WALK);
		AI_GotoWP(self,self.wp);
		AI_AlignToWP(self);
		self.aivar[AIV_TAPOSITION] = NOTINPOS;
	};
};

func int ZS_Stand_WP_loop()
{
	var int random;
	var int randomMove;
	if((self.guild == GIL_ORC) || (self.aivar[AIV_MM_REAL_ID] == ID_ORCBF))
	{
		if(self.aivar[AIV_TAPOSITION] == NOTINPOS)
		{
			if(Wld_IsFPAvailable(self,"FP_STAND"))
			{
				AI_GotoFP(self,"FP_STAND");
			};
			if(Npc_IsOnFP(self,"FP_STAND"))
			{
				self.aivar[AIV_TAPOSITION] = ISINPOS;
			};
		}
		else if(Hlp_Random(1000) <= 5)
		{
			randomMove = Hlp_Random(3);
			if(randomMove == 0)
			{
				AI_PlayAni(self,"R_ROAM1");
			};
			if(randomMove == 1)
			{
				AI_PlayAni(self,"R_ROAM2");
			};
			if(randomMove == 2)
			{
				AI_PlayAni(self,"R_ROAM3");
			};
		};
	}
	else
	{
		if(self.aivar[AIV_TAPOSITION] == NOTINPOS)
		{
			AI_PlayAni(self,"T_STAND_2_LGUARD");
			self.aivar[AIV_TAPOSITION] = ISINPOS;
		};
		if((Npc_GetStateTime(self) > 5) && (self.aivar[AIV_TAPOSITION] == ISINPOS))
		{
			random = Hlp_Random(10);
			if(random == 0)
			{
				AI_PlayAni(self,"T_LGUARD_SCRATCH");
			}
			else if(random == 1)
			{
				AI_PlayAni(self,"T_LGUARD_STRETCH");
			}
			else if(random == 2)
			{
				AI_PlayAni(self,"T_LGUARD_CHANGELEG");
			};
			Npc_SetStateTime(self,0);
		};
	};
	return LOOP_CONTINUE;
};

func void ZS_Stand_WP_end()
{
	AI_PlayAni(self,"T_LGUARD_2_STAND");
};

